# import requests # 据说没有指纹验证
import pyhttpx
# from curl_cffi import requests

session = pyhttpx.HttpSession()

def html(spider_url):
    """ 爬取网页文本内容
        :param spider_url 要爬取的网页
        :return 返回文本
    """
    header = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"
    }

    response = session.get(url=spider_url,headers=header)
    # response = requests.get(spider_url, headers=header)
    # response = requests.get(url=spider_url, impersonate="chrome104")

    # 是否爬取成功
    # response.raise_for_status()

    # 保证编码
    # response.encoding = response.apparent_encoding

    return response.text

def hello(): 
    print("Hello get.py")